feat(Select): mark the latest version with a badge instead of a label suffix - #1157
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe select component now supports optional badges for selected and dropdown options. VersionSelect displays the latest version number with a separate ChangesSelect option badges
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to The latest-version marker is moved into a badge without changing the version value or other select behavior; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 948e479 | Commit Preview URL Branch Preview URL |
Aug 14 2026, 05:33 PM |
The version picker rendered the current version as one string,
v5 - Latest, so the version number and the "this is current" marker competed for the same reading. Pulling the marker into a badge lets the number carry the label on its own.SelectOptiongains an optionalbadge, matching the existing optionallogo:labelstays astring, so the two placesSelectconsumes it as text (alt={${option.label} logo}) are unaffected.The badge is the DS
Badgewith no props and no style overrides, so it renders the neutraldefaultvariant (bg-background-subtle/text-text-secondary). That keeps it clear of every library's accent colour — the docs sidebar sits inside a library-themed page, and a coloured badge would compete there. UI-chrome badges acrossadmin/andaccount/use the component's defaults the same way; the squared, mono, uppercase treatment belongs to the landing pages, which are a separate visual language.Scope
SelectOptionis constructed in exactly one place (VersionSelect).FrameworkSelectpasses nobadge, so its render path is unchanged — verified by measurement, not just by reading: its trigger still measures 207px with no badge node.ShopSelectis an unrelated component inshop/ui/. Nothing insrc/,tests/, orscripts/depends on the" - Latest"string.Verified in the browser
VersionSelectrenders in two places inLibraryLayout— the desktop sidebar and the mobile drawer — and both were checked:In the open dropdown the badge's right edge sits 66px clear of the check mark, so the row's
pr-8reservation still holds. Checked on Query (v5/v4/v3) and Router (v1, single option).Accessibility is unchanged. The badge is
display: flex, so the accessible name computation inserts a boundary:innerTextreads"v5\nLatest"where it previously read"v5 - Latest". Both announce as two words. Separately, the select trigger has no accessible name at all — butFrameworkSelect, which this PR does not touch, has the same gap, so it predates this change and is left for its own fix.tsc,oxlintand the 140 unit tests pass.Screenshot
AS-IS
TO-BE
Summary by CodeRabbit
New Features
UI Improvements